package kt.base


interface Printer {
    fun printTest(s: String)
}

class RealPrinter : Printer {
    override fun printTest(s: String) {
        println(s)
    }
}

class PrintImpl(p: Printer) : Printer by p{

    fun doSome(){
        println("do some ... ")
    }

    inline fun wrapPrint(action : () -> Unit){
        println("before doing some ")
        action()
        printTest("....")
        println("after doing some")
    }

}

fun main(args: Array<String>) {
    val ps = PrintImpl(RealPrinter())
    ps.printTest("hello world")
    ps.doSome()

    ps.wrapPrint {
        println("inline function ... ")
    }
}
